import React from "react";
import {Provider} from "react-redux";
import {PersistGate} from 'redux-persist/integration/react';
import {ThemeProvider} from "@rn-vui/themed";
import {GestureHandlerRootView} from 'react-native-gesture-handler';
import store, {persistor} from "./store";
import Theme from "./themes/Theme";
import AppInitialization from "./pages/components/AppInitialization.tsx";
import AppContainer from "./containers/AppContainer.tsx";
import Confirm from "./pages/components/Confirm.tsx";
import Loading from "./pages/components/Loading.tsx";

const Root = () => {
    return (
        <GestureHandlerRootView style={{flex: 1, backgroundColor: '#fff'}}>
            <Provider store={store}>
                <PersistGate persistor={persistor}>
                    <ThemeProvider theme={Theme}>
                        <AppContainer/>
                        <AppInitialization/>
                        <Confirm/>
                        <Loading/>
                    </ThemeProvider>
                </PersistGate>
            </Provider>
        </GestureHandlerRootView>
    );
};
export default Root;
